<template>
  <div id="content" class="blog blog-single">
    <article class="clearfix" style="width:96%;margin:2%;">
      <div class="place-padding">
        <h2 class="blog-title">{{title}}</h2>
        <div class="post-meta">
          <span class="category">
            分类:
            <a href="#" rel="category tag">性感妹子</a>
          </span>
          <span class="time"></span>
        </div>
      </div>
      <mt-swipe :auto="0" :show-indicators="false">
        <mt-swipe-item v-for="(item,index) in images" :key="index">
          <div class="place-padding">
            <figure>
              <p>
                <a style="padding-top:133.28571428571%">
                  <img :src="item.url" :alt="title">
                </a>
              </p>
            </figure>
          </div>
        </mt-swipe-item>
      </mt-swipe>
    </article>

    <!-- <div class="place-padding">
      <div class="single-page">
        <div class="prev-next">
          <a class="prev button radius" href="/hot/">«上一组</a>
          <span class="prev-next-page">{{current}}/{{number}}页</span>
          <a class="next button radius" href="https://m.mzitu.com/184413/2">下一页»</a>
        </div>
      </div>
    </div>-->
  </div>
</template>
<script>
export default {
  created() {
    console.log(this.getUrl());
    this.$http.get(this.getUrl()).then(res => {
      this.images = res.data.imgs;
      this.title = res.data.title;
      this.number = this.images.length;
      console.log(this.images);
    });
  },
  data() {
    return {
      title: "",
      number: 0,
      current: 1,
      images: []
    };
  },
  methods: {
    getUrl() {
      return `/api/img/detail?cid=200&type=2&id=${this.$route.params.id}`;
    }
  }
};
</script>
<style lang="scss">
.mint-swipe {
  overflow: hidden;
  position: relative;
  height: 540px;
  .mint-swipe-items-wrap {
    position: relative;
    overflow: hidden;
    height: 100%;
    & > div {
      position: absolute;
      transform: translateX(-100%);
      size: 100% 100%;
      display: none;
      &.is-active {
        display: block;
        transform: none;
      }
    }
  }
  .mint-swipe-indicators {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
  }
  .mint-swipe-indicator {
    width: 8px;
    height: 8px;
    size: 8px 8px;
    display: inline-block;
    border-radius: 100%;
    background: #000;
    opacity: 0.2;
    margin: 0 3px;
    &.is-active {
      background: #ccc;
    }
  }
}
</style>
